package net.cathackers.devel.scmp.chat.impl.xmpp.iqcomponent.interfaces;

import org.dom4j.Document;

import net.cathackers.devel.scmp.xmpp.Packet;
import net.cathackers.devel.scmp.xmpp.exceptions.UnknownPacket;

/**
 * PacketRouter handles incoming packets and route it to their corresponding
 * component according to the type of packets
 * 
 */
public interface PacketRouter {
    /**
     * route packets
     * 
     * @param packet
     */
    void route(Packet packet);

    /**
     * route document to PacketRegistery to create packet of this document and
     * then route it to its corresponding component
     * 
     * @param doc
     * @param sessionID
     * @throws UnknownPacket
     */
    void route(Document doc, String sessionID) throws UnknownPacket;

}
